<template>
	<view class="header-box">
		<view class="navbar">
			<view :class="selectTab==0?'nav-item active':'nav-item'" @click="selectTab=0">消息</view>
			<view :class="selectTab==1?'nav-item active':'nav-item'" @click="selectTab=1">看过我</view>
			<view :class="selectTab==2?'nav-item active':'nav-item'" @click="selectTab=2">新职位</view>
		</view>
		<view class="search">
			<input type="text" placeholder="搜索职位、公司">
			<image src="@/static/img/chat/icon-add.png" mode="scaleToFill" @click="showSelect=!showSelect" />
			<view class="select-box" v-if="showSelect">
				<view class="select-item">
					<image src="@/static/img/chat/icon-fqql.png" mode=""></image>
					<text>发起群聊</text>
				</view>
				<view class="select-item">
					<image src="@/static/img/chat/icon-tjpy.png" mode=""></image>
					<text>添加朋友</text>
				</view>
			</view>
		</view>
	</view>
	<NewsList v-if="selectTab==0" :list="newsList"></NewsList>
	<SeenMe  v-if="selectTab==1" :list="SeenMeList"></SeenMe>
	<NewJob  v-if="selectTab==2" :list="newJobList"></NewJob>
</template>

<script setup lang="ts">
	import { ref } from 'vue';
	import NewsList from './component/newsList.vue';
	import SeenMe from './component/seenMe.vue';
	import NewJob from './component/newJob.vue';
	let showSelect = ref(false);
	let selectTab=ref(0);
	let newsList = ref([]);
	let SeenMeList = ref([]);
	let newJobList = ref([]);
</script>

<style scoped lang="scss">
	.header-box {
		background: linear-gradient(180deg,
				#005eff 0%,
				#00cbff 100%,
				rgba(0, 170, 255, 0.85) 100%);
		padding-bottom: 30rpx;

		.navbar {
			width: 100%;
			height: 108rpx;
			padding: 0 20rpx;
			font-size: 40rpx;
			color: #ffffff;
			display: flex;
			align-items: center;

			.nav-item {
				display: flex;
				align-items: center;
				justify-content: center;
				height: 100%;
				margin: 0 32rpx;
			}

			.nav-item.active {
				background: url("@/static/img/chat/icon-nav-bg.png") center bottom no-repeat;
				background-size: 60rpx;
				font-size: 46rpx;
				color: #ffede1;
			}
		}

		.search {
			width: 100%;
			height: 150rpx;
			padding: 0 18rpx;
			display: flex;
			justify-content: space-between;
			align-items: center;
			position: relative;

			image {
				width: 64rpx;
				height: 64rpx;
				flex-shrink: 0;
			}

			input {
				width: 628rpx;
				height: 80rpx;
				border-radius: 40rpx;
				padding: 0 40rpx 0 76rpx;
				margin-right: 24rpx;
				flex-shrink: 1;
				background: url("@/static/img/chat/search-bg.png") 32rpx center no-repeat #ffffff;
				background-size: 36rpx;
				font-size: 32rpx;
			}

			.select-box {
				position: absolute;
				padding: 8rpx 0;
				right: 18rpx;
				top: 125rpx;
				background: #2E2D2D;
				border-radius: 20rpx;
				color: #fff;
				font-size: 28rpx;

				&::after {
					content: '';
					position: absolute;
					right: 26rpx;
					top: -10rpx;
					width: 20rpx;
					height: 20rpx;
					background: #2E2D2D;
					transform: rotate(45deg);
				}

				.select-item {
					display: flex;
					align-items: center;
					justify-content: space-between;

					image {
						width: 44rpx;
						height: 44rpx;
						margin: 0 22rpx;
					}

					text {
						padding: 18rpx 40rpx 18rpx 0;
						border-bottom: 1rpx solid rgba(255, 255, 255, 0.4);
					}

					&:last-child text {
						border-bottom: 0;
					}
				}
			}
		}

	}
</style>